package com.ag.zrt.dao;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.ag.bean.TbEventPlanStart;
import com.ag.dao.TbEventPlanStartDAO;

public class ZRTEventPlanStartDAO extends TbEventPlanStartDAO {

	private static final Log log = LogFactory.getLog(TbEventPlanStartDAO.class);

	public List<TbEventPlanStart> findByEventId(String eventId) {
		log.debug("getting TbEventPlanStart instance with eventId: " + eventId);
		try {
			String hql = "from TbEventPlanStart eps join fetch eps.tbPlanStandard where "
					+ " eps.tbEvent.EId = " + eventId;
			// TbEventPlanStart instance = (TbEventPlanStart)
			// getHibernateTemplate()
			// .get("com.ag.bean.TbEventPlanStart", id);
			System.out.println(getHibernateTemplate().find(hql).size()+"----------------------------getHibernateTemplate().find(hql).size()---------------------------------------");
			if (getHibernateTemplate().find(hql).size() != 0) {
				return getHibernateTemplate().find(hql);
			}
			return null;
		} catch (RuntimeException re) {
			log.error("get failed", re);
			throw re;
		}
	}

}
